$(function(){
  $("body").css("visibility","visible");
})
function creatStar(obj,num){
  var $obj = $(obj);
  for(var i=0;i<=num;i++){
    var l = parseInt(randomInteger(10,1070));
    var h = parseInt(randomInteger(10,1600));
    //alert(0)
    var bs = parseInt(randomInteger(1,3));
    var op = parseInt(randomInteger(2,5))*2/10;
    $obj.append('<span class="bs-'+bs+'" style="opacity:'+op+' ; top:'+h+'px; left:'+l+'px"></span>');
  }

}

function randomInteger(min, max){
    return min + Math.floor(Math.random() * (max - min));
}
Array.prototype.remove = function(val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
};

function showPop(text,h,url){
  $.ajax({
    type: "GET",
    url: "pages/pop-error.html",
    success: function(data){
      $("body").append(data);
      $(".pop-box-error").find(".text").text(text);
      $(".pop-box-error").find("a").text(h);
      $(".pop-box-error .tips").css({
          "height":"450px",
          "top":"625px"
      });
      $(".pop-box-error .close").on("click",function(){
        $(".pop-box-error").remove();
      });
      $(".pop-box-error a").on("click",function(e){
        if(url){
          window.location.href=url;//返回首页
        }else{
          $(".pop-box-error").remove();
        }
      });
    }
  });
}
